// export default {
//   token: (state) => state.app.token,
//   siderType: (state) => state.app.siderType,
//   lang: (state) => state.app.lang
// }
const getters = {
  token: (state) => state.app.token,
  siderType: (state) => state.app.siderType,
  lang: (state) => state.app.lang,
  count: (state) => state.count.count,
  list: (state) => state.list.list,
  //  count
  showNum: (state) => {
    return '当前最新的数量是【' + state.count.count + '】'
  },
  //  list
  unDoneLength(state) {
    return state.list.list.filter((x) => x.done === false).length
  },
  infolist(state) {
    if (state.list.viewKey === 'all') {
      return state.list.list
    }
    if (state.list.viewKey === 'undone') {
      return state.list.list.filter((x) => !x.done)
    }
    if (state.list.viewKey === 'done') {
      return state.list.list.filter((x) => x.done)
    }
    return state.list.list
  }
}

export default getters
